package pw.archipelag.loaderGame.panel.scores {
	import flash.display.Shape;
	import flash.display.Sprite;
	import pw.archipelag.loaderGame.interfaceGame.skinsPanel.SkinScores;
	import base.math.MathExt;
	
	public class ItemScoreAbstract extends Sprite {
		
		static internal var WIDTH: Number;
		static internal var HEIGHT: Number;
		
		private var isEvenOdd: uint;
		protected var bg: Shape;
		
		public function ItemScoreAbstract(isEvenOdd: uint): void {
			this.isEvenOdd = isEvenOdd;
			this.createBg();
		}

		private function createBg(): void {
			this.bg = new Shape();
			this.addChild(this.bg)
		}
		
		public function draw(skinScores: SkinScores): void {
			this.bg.graphics.clear();
			var colorScrollItemBg: uint = [skinScores.colorScrollItemBgEven, skinScores.colorScrollItemBgOdd][this.isEvenOdd];
			this.bg.graphics.beginFill(colorScrollItemBg, MathExt.extractChannel(colorScrollItemBg));
			this.bg.graphics.drawRect(0, 0, 1, 1);
			this.bg.graphics.endFill();
			this.bg.width = ItemScoreAbstract.WIDTH;
			this.bg.height = ItemScoreAbstract.HEIGHT;
		}
		
		override public function get width(): Number {
			return ItemScoreAbstract.WIDTH;
		}
		
		override public function set width(value: Number): void {
			this.bg.width = value;
		}
		
		override public function get height(): Number {
			return ItemScoreAbstract.HEIGHT;
		}
		
	}

}